<?
	ob_start();
	header('Content-Type:application/json; charset=utf8');
	header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
	header("Last-Modified:".gmdate("D, d M Y H:i:s")." GMT");
	header("Cache-Control: no-cache, must-revalidate");
	header("Pramga: no-cache");
	header('Access-Control-Allow-Origin: *');
	// 链接数据库
	include_once('include/conn_db.php');
	include_once('include/db_class.php');
	mysql_connect(HOST,NAME,PASS) or die(mysql_error());
	mysql_select_db(DBNAME);
	mysql_query('SET NAMES '.CODEPAGE);
	$mydb = new mydb();
	
	/**************************************
	** 一次性支付页面
	***************************************/
	// 初始化
	include 'WeixinPay.php';
	$appid = 'wxf8882d2559d49ba8';
	$openid= $_POST['openid'];
	$mch_id=''; //商户号
	$key='';//微信支付密匙
	$out_trade_no = $mch_id.time();
	$total_fee = $_POST['fee'];
	$body = "付费答题";
	$total_fee = floatval($total_fee*100);
	// // 调用类
	// $weixinpay = new WeixinPay($appid,$openid,$mch_id,$key,$out_trade_no,$body,$total_fee);
	// $return=$weixinpay->pay();
	// //  输出
	// echo json_encode($return);
	mysql_close();
?>